Enable more tests to run on all 3 runtimes, part 14 #10644
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to how Android runtime variants are handled in device integration tests. The key change is to parameterize tests by
AndroidRuntime, ensuring that each runtime uses a unique package name and configuration. This prevents cross-runtime interference and enables broader test coverage. Additionally, a utility method is introduced to standardize package name generation.Test parameterization and runtime handling:
Major device integration tests (
LocalizationTests,TimeZoneInfoTests,SystemApplicationTests,UncaughtExceptionTests,MonoAndroidExportTest, andMarshalMethodsGCHangTests) are updated to run against allAndroidRuntimevalues using[Values]or[TestFixtureSource], with appropriate handling for unsupported configurations and unique per-runtime package names.Tests now set the runtime explicitly on
XamarinAndroidApplicationProjectand related objects, and adjust build configurations such asIsReleaseandSupportedOSPlatformVersionbased on the runtime.Utility and infrastructure improvements:
A new
PackageUtils.MakePackageNamemethod is added to generate unique package names per runtime, and is used throughout the updated tests to avoid conflicts.Test project creation and setup now use the test name and runtime to ensure isolation and reproducibility.
Test codebase maintenance:
Xamarin.Android.Tasksare added to relevant test files to support the new runtime and package utilities.These changes collectively improve test reliability and coverage across different Android runtime implementations.